/*
 * @(#)Patient.java 1.0.0 27/05/2014 *
 * INTRODUCCION A APLICACIONES J2EE
 * Ing. Darwin Rodrigo Zottola Pareja
 * rodrigozeta@gmail.com - twitter @Monozeta
 */
package com.unt.javawebunt.dto;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Patient entity
 * 
 * @author rzottola
 * @version 1.0
 * @since 27/05/2014
 */
@Entity
@Table(name="patients",catalog="db_java_web")
public class PatientDTO implements Serializable{

	
	public PatientDTO(){}
	
	public PatientDTO(Long id, String name, String address,
			Set<PatientDTO> patientList) {
		
		this.id = id;
		this.name = name;
		this.address = address;
		//this.patientList = patientList;
	}

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Long id;
	
	@Column(name="NAME")
	private String name;
	
	@Column(name="ADDRESS")
	private String address;

	
	
	@OneToMany(cascade=CascadeType.ALL)
    @JoinColumn(name="ID_PATIENT")
	Set<PatientDTO> patientList;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Set<PatientDTO> getPatientList() {
		return patientList;
	}

	public void setPatientList(Set<PatientDTO> patientList) {
		this.patientList = patientList;
	}

}
